﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace killsm
{
    public partial class FrmSelect : Form
    {
        public string ProcessName { get; set; }
        public FrmSelect()
        {
            InitializeComponent();
        }

        private void FrmSelect_Load(object sender, EventArgs e)
        {
            Process[] proList = Process.GetProcesses();
            foreach (Process pro in proList)
            {
                listView1.Items.Add(new ListViewItem(new string[] { pro.ProcessName + ".exe", pro.Id.ToString(), (pro.WorkingSet64 / 1024).ToString() }));
            }
        }
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            ProcessName = listView1.SelectedItems[0].SubItems[0].Text;
            this.Close();
        }
    }
}
